﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class MenuSetCommandHandler : IRequestHandler<MenuSetCommand, MenuInfo>
    {
        protected readonly IMenuSerivice serivice;

        public MenuSetCommandHandler(IMenuSerivice serivice)
        {
            this.serivice = serivice;
        }

        public async Task<MenuInfo> Handle(MenuSetCommand request, CancellationToken cancellationToken)
        {
            return await serivice.GetMenuByid(request.id);
        }
    }
}
